local qiangjian = fk.CreateSkill{
  name = "investiture__qiangjian",
}

Fk:loadTranslationTable{
  ["investiture__qiangjian"] = "强谏",
  [":investiture__qiangjian"] = "出牌阶段限一次，你可令一名其他角色摸两张牌，然后你可将一张牌当【推心置腹】对其使用。若如此做，其可弃置两张牌，将此技能于此回合改为出牌阶段限两次。",

  ["#investiture__qiangjian"] = "可以令一名其他角色摸两张牌",
  ["#investiture__qiangjian-use"] = "强谏：可以将一张手牌当【推心置腹】对 %src 使用",
  ["#investiture__qiangjian-discard"] = "强谏：可以弃置两张牌令“强谏”此回合改为出牌阶段限两次",

  ["$investiture__qiangjian1"] = "大王，臣看着大王长大，又受先王重托扶政；虽告老还乡，但忠心未泯，今朝局混乱，特来进谏。",
  ["$investiture__qiangjian2"] = "昏君，你再执迷不悟，不思悔改，那好端端的锦绣山河，就会被你断送的干干净净，令先王在九泉之下寒心呐！",
}

qiangjian:addEffect("active", {
  anim_type = "support",
  prompt = "#investiture__qiangjian",
  card_num = 0,
  target_num = 1,
  can_use = function (self, player)
    return player:usedSkillTimes(qiangjian.name, Player.HistoryPhase) <= player:getMark("investiture__qiangjian-turn")
  end,
  card_filter = Util.FalseFunc,
  target_filter = function (self, player, to_select, selected, selected_cards)
    return #selected == 0 and to_select ~= player
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    target:drawCards(2, qiangjian.name)

    local card = Fk:cloneCard("sincere_treat")
    card.skillName = qiangjian.name
    if player:isAlive() and not player:isNude() and table.contains(card:getAvailableTargets(player, { bypass_distances = true }), target) then
      local sub = room:askToCards(player, {
        min_num = 1,
        max_num = 1,
        skill_name = qiangjian.name,
        cancelable = true,
        prompt = "#investiture__qiangjian-use:"..target.id,
        include_equip = true
      })
      if #sub > 0 then
        card:addSubcards(sub)
        room:useCard{
          card = card,
          from = player,
          tos = { target },
        }
        if target:isAlive() then
          if #room:askToDiscard(target, {
            min_num = 2,
            max_num = 2,
            skill_name = qiangjian.name,
            cancelable = true,
            include_equip = true,
            prompt = "#investiture__qiangjian-discard"
          }) == 2 then
            room:setPlayerMark(player, "investiture__qiangjian-turn", 1)
          end
        end
      end
    end
  end,
})

return qiangjian